//package com.jialianiot.myapplication;
//
//import android.animation.AnimatorSet;
//import android.animation.ValueAnimator;
//import android.app.Activity;
//import android.graphics.Point;
//import android.os.Handler;
//import android.util.DisplayMetrics;
//import android.view.Display;
//import android.view.View;
//import android.widget.ImageView;
//import android.widget.RelativeLayout;
//
//public class AnimatorHealthy90V1Util {
//
//    /**动画变量**/
//    private static int centerX;
//    private static int centerY;
//    private static int ANIMATION_DURATION = 1300; // 九球发散动画时长
//    private static int ANIMATION_DURATION_2 = 1000; // 九球漂浮动画时长
//
//    /**背景图片**/
//    private static ImageView iv_bg;
//
//    private static RelativeLayout relative_ball_father;
//    private static RelativeLayout relative_title_father;
//    private static RelativeLayout relative_background_father;
//
//    /**九球参数**/
//    private static ImageView image_bg;
//    private static ImageView icon_2;
//    private static ImageView icon_3;
//    private static ImageView icon_4;
//    private static ImageView icon_5;
//    private static ImageView icon_6;
//    private static ImageView icon_7;
//    private static ImageView icon_8;
//    private static ImageView icon_9;
//    private static ImageView[] imageViews;
//    private static int BALL_NUM = 9; // 球数数量
//    private static Point[] points;
//    private static int[] enterDelay = {0, 100, 200, 300, 400, 500, 600, 500, 400};
//    private static int[] exitDelay = {80, 40, 0, 120, 160, 200, 240, 280, 320};
//    private static int height, width;
//
//    private static int DisplayWeight;
//    private static int DisplayHeight;
//    private static int ball_1_x;
//    private static int ball_1_y;
//    private static int ball_2_x, ball_2_y;
//    private static int ball_3_x, ball_3_y;
//    private static int ball_4_x, ball_4_y;
//    private static int ball_5_x, ball_5_y;
//    private static int ball_6_x, ball_6_y;
//    private static int ball_7_x, ball_7_y;
//    private static int ball_8_x, ball_8_y;
//    private static int ball_9_x, ball_9_y;
//
//    private static int startPositionX = 0;
//    private static int startPositionY = 0;
//
//    private static ImageView title_1;
//    private static ImageView title_2;
//    private static ImageView title_3;
//    private static ImageView title_4;
//    private static ImageView title_5;
//    private static ImageView title_6;
//    private static ImageView title_7;
//    private static ImageView title_8;
//    private static ImageView title_9;
//    private static ImageView[] titles;
//    private static Point[] titlePoints;
//
//    private static int title_1_x, title_1_y;
//    private static int title_2_x, title_2_y;
//    private static int title_3_x, title_3_y;
//    private static int title_4_x, title_4_y;
//    private static int title_5_x, title_5_y;
//    private static int title_6_x, title_6_y;
//    private static int title_7_x, title_7_y;
//    private static int title_8_x, title_8_y;
//    private static int title_9_x, title_9_y;
//
//
//    private static AnimatorSet ballAnimator1;
//
//
//    /**
//     * 获取 包含多个球形父视图 的 中心坐标
//     */
//    public static void doAnimatorPlay(final Activity activity) {
//        // 获取背景父控件
//        getBackgroundFatherView(activity);
//        // 等待九球父控件加载完成
//        relative_ball_father.post(new Runnable() {
//            @Override
//            public void run() {
//                // 获取九球父控件中心坐标
//                initBallFatherViewCenter(activity);
//                // 获取九球子控件（球和标题）
//                getBackgroundView(activity);
//                // 获取屏幕绝对分辨率
//                getPixels(activity);
//                //九球&标题位置初始化
//                initDisplay(activity);
//                //九球初始化
//                initNineBall(activity);
//                initNineTitle(activity);
//                initNineLine(activity);
//                //播放背景动画
//                new Handler().postDelayed(new Runnable() {
//                    @Override
//                    public void run() {
//                        playBackground(activity);
//                    }
//                }, 500);
//            }
//        });
//    }
//
//    /**
//     * 获取屏幕中心坐标
//     */
//    private static void initCenter(Activity activity) {
//        Display display = activity.getWindowManager().getDefaultDisplay();
//        centerX = display.getWidth() / 2;
//        centerY = display.getHeight() / 2;
//        Tools.logByWh("Animator - initCenter - centerX = " + centerX + " centerY = " + centerY);
//    }
//
//    /**
//     * 获取连接线父控件
//     */
//    private static void getBackgroundFatherView(Activity activity) {
//        relative_background_father = activity.findViewById(R.id.relative_background_father);
//    }
//
//    /**
//     * 获取九球父控件中心坐标
//     */
//    private static void initBallFatherViewCenter(Activity activity) {
//        centerX = relative_ball_father.getWidth() / 2;
//        centerY = relative_ball_father.getHeight() / 2;
//        Tools.logByWh("Animator - initBallFatherViewCenter - centerX = " + centerX + " centerY = " + centerY);
//    }
//
//    /**
//     * 获取九球父控件
//     */
//    private static void getBackgroundView(Activity activity) {
//        image_bg = activity.findViewById(R.id.image_bg);
//    }
//
//    /**
//     * 获取屏幕绝对分辨率
//     */
//    public static void getPixels(Activity activity) {
//        DisplayMetrics metric = new DisplayMetrics();
//        activity.getWindowManager().getDefaultDisplay().getMetrics(metric);
//        DisplayHeight = metric.heightPixels;
//        DisplayWeight = metric.widthPixels;
//    }
//
//    /**
//     * 九球&标题位置初始化
//     */
//    public static void initDisplay(Activity activity) {
//        float moreX = 1.0f;
//        float moreY = 1.0f;
//
//        // 初始化九球中心点
//        ball_1_x = (int) (centerX+(875-535)/535f*centerX*moreX);
//        ball_1_y = (int) (centerY+(222-905)/905f*centerY*moreY-centerY*0.05);
//        ball_2_x = (int) (centerX+(157-535)/535f*centerX*moreX);
//        ball_2_y = (int) (centerY+(222-905)/905f*centerY*moreY-centerY*0.05);
//        ball_3_x = (int) (centerX+(417-535)/535f*centerX*moreX);
//        ball_3_y = (int) (centerY+(475-905)/905f*centerY*moreY-centerY*0.05);
//        ball_4_x = (int) (centerX+(448-535)/535f*centerX*moreX-centerX*0.00);
//        ball_4_y = (int) (centerY+(699-905)/905f*centerY*moreY-centerY*0.05+centerY*0.07);
//        ball_5_x = (int) (centerX+(522-535)/535f*centerX*moreX);
//        ball_5_y = (int) (centerY+(991-905)/905f*centerY*moreY-centerY*0.05+centerY*0.13);
//        ball_6_x = (int) (centerX+(381-535)/535f*centerX*moreX+centerX*0.05);
//        ball_6_y = (int) (centerY+(1187-905)/905f*centerY*moreY-centerY*0.05+centerY*0.19);
//        ball_7_x = (int) (centerX+(612-535)/535f*centerX*moreX+centerX*0.05);
//        ball_7_y = (int) (centerY+(1487-905)/905f*centerY*moreY-centerY*0.05+centerY*0.15);
//        ball_8_x = (int) (centerX+(889-535)/535f*centerX*moreX);
//        ball_8_y = (int) (centerY+(1380-905)/905f*centerY*moreY+centerY*0.00);
//        ball_9_x = (int) (centerX+(535-535)/535f*centerX*moreX);
//        ball_9_y = (int) (centerY+(905-905)/905f*centerY*moreY+centerY*0.00);
//
//        Tools.logByWh("Animator - ball_1_x = " + ball_1_x + " ball_1_y = " + ball_1_y);
//        Tools.logByWh("Animator - ball_2_x = " + ball_2_x + " ball_2_y = " + ball_2_y);
//        Tools.logByWh("Animator - ball_3_x = " + ball_3_x + " ball_3_y = " + ball_3_y);
//        Tools.logByWh("Animator - ball_4_x = " + ball_4_x + " ball_4_y = " + ball_4_y);
//        Tools.logByWh("Animator - ball_5_x = " + ball_5_x + " ball_5_y = " + ball_5_y);
//        Tools.logByWh("Animator - ball_6_x = " + ball_6_x + " ball_6_y = " + ball_6_y);
//        Tools.logByWh("Animator - ball_7_x = " + ball_7_x + " ball_7_y = " + ball_7_y);
//        Tools.logByWh("Animator - ball_8_x = " + ball_8_x + " ball_8_y = " + ball_8_y);
//        Tools.logByWh("Animator - ball_9_x = " + ball_9_x + " ball_9_y = " + ball_9_y);
//
//        // 初始化九个标题中心点
//        title_1_x = (int) (centerX+(881-535)/535f*centerX*moreX-centerX*0.01);
//        title_1_y = (int) (centerY+(381-905)/905f*centerY*moreY-centerY*0.03);
//        title_2_x = (int) (centerX+(342-535)/535f*centerX*moreX-centerX*0.01);
//        title_2_y = (int) (centerY+(211-905)/905f*centerY*moreY-centerY*0.03);
//        title_3_x = (int) (centerX+(649-535)/535f*centerX*moreX-centerX*0.03);
//        title_3_y = (int) (centerY+(487-905)/905f*centerY*moreY-centerY*0.06);
//        title_4_x = (int) (centerX+(623-535)/535f*centerX*moreX-centerX*0.03);
//        title_4_y = (int) (centerY+(711-905)/905f*centerY*moreY+centerY*0.01);
//        title_5_x = (int) (centerX+(720-535)/535f*centerX*moreX-centerX*0.04);
//        title_5_y = (int) (centerY+(1004-905)/905f*centerY*moreY-centerY*0.05+centerY*0.13);
//        title_6_x = (int) (centerX+(623-535)/535f*centerX*moreX+centerX*0.02);
//        title_6_y = (int) (centerY+(1202-905)/905f*centerY*moreY+centerY*0.13);
//        title_7_x = (int) (centerX+(637-535)/535f*centerX*moreX-centerX*0.00);
//        title_7_y = (int) (centerY+(1630-905)/905f*centerY*moreY+centerY*0.10);
//        title_8_x = (int) (centerX+(903-535)/535f*centerX*moreX-centerX*0.03);
//        title_8_y = (int) (centerY+(1521-905)/905f*centerY*moreY+centerY*0.00);
//        title_9_x = (int) (centerX+(535-535)/535f*centerX*moreX);
//        title_9_y = (int) (centerY+(905-905)/905f*centerY*moreY+centerY*0.00);
//    }
//
//    private static void playBackground(Activity activity) {
//        startPositionX = centerX;
//        startPositionY = centerY;
//            image_bg.setX(startPositionX);
//            image_bg.setY(startPositionY);
//            image_bg.setVisibility(View.VISIBLE);
//            playBackgroundAnimation(image_bg, activity);
//    }
//
//
//    /**
//     * 播放九球放大动画 - 位移放大
//     */
//    private static void playBackgroundAnimation(final ImageView imageView, Activity activity) {
//
//        /**
//         * 更新alpha - 九球变大
//         */
//        final ValueAnimator alphaAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
//        alphaAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                imageView.setAlpha((float)alphaAnimator.getAnimatedValue());
//                imageView.requestLayout();
//            }
//        });
//        alphaAnimator.setDuration(ANIMATION_DURATION);
//
////        width = (int) activity.getResources().getDimension(R.dimen.button_width);
//
//        /**
//         * 动画，动画按钮的X和Y位置同时与尺寸
//         */
//        ballAnimator1 = new AnimatorSet(); // 动画集合 按钮动画 = new 动画集合();
//
//        /**
//         * 更新x - 九球x轴位置
//         */
//        ValueAnimator ballAnimator1X = ValueAnimator.ofFloat(startPositionX,
//                points[position].x);
//        ballAnimator1X.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                imageView.setX((float) animation.getAnimatedValue() - imageView.getLayoutParams().width / 2);
////                imageView.setX((float) animation.getAnimatedValue());
//                imageView.requestLayout();
//            }
//        });
//        ballAnimator1X.setDuration(ANIMATION_DURATION);
//
//        /**
//         * 更新y - 九球y轴位置
//         */
//        ValueAnimator ballAnimator1Y = ValueAnimator.ofFloat(startPositionY,
//                points[position].y);
//        ballAnimator1Y.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                imageView.setY((float) animation.getAnimatedValue() - imageView.getLayoutParams().height / 2);
////                imageView.setY((float) animation.getAnimatedValue());
//                imageView.requestLayout();
//            }
//        });
//        ballAnimator1Y.setDuration(ANIMATION_DURATION);
//
//        /**
//         * 更新大小 -  九球变大
//         */
//        ValueAnimator buttonSizeAnimator = ValueAnimator.ofInt(1, width);
//        float moreSize = 1.0f;
//        if (position==0){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((209f/1080*moreSize)*DisplayWeight));
//        }else if (position==1){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==2){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==3){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==4){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==5){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==6){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==7){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }else if (position==8){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((157f/1080*moreSize)*DisplayWeight));
//        }
//        buttonSizeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                imageView.getLayoutParams().width = (int) animation.getAnimatedValue();
//                imageView.getLayoutParams().height = (int) animation.getAnimatedValue();
//                imageView.requestLayout();
//            }
//        });
//        buttonSizeAnimator.setDuration(ANIMATION_DURATION);
//
//        /**
//         * 组合播放
//         */
//        ballAnimator1.play(ballAnimator1X).with(ballAnimator1Y).with(buttonSizeAnimator).with(alphaAnimator);
//        ballAnimator1.setStartDelay(enterDelay[position]);
//        ballAnimator1.start();
//
//
//        /**
//         * 九球漂浮动画
//         */
////        AnimatorSet buttonAnimator2 = new AnimatorSet();
////        ValueAnimator buttonAnimatorY2;
////        if(position == 0){
////            buttonAnimatorY2 = ValueAnimator.ofFloat(points[position].y - 105,
////                    points[position].y - 105 - 10);
////        } else {
////            buttonAnimatorY2 = ValueAnimator.ofFloat(points[position].y - 79,
////                    points[position].y - 79 - 10);
////        }
////        Tools.logByWh("Animator - 九球漂浮动画 - position = " + position + " points[position].y = " + points[position].y);
////        buttonAnimatorY2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
////            @Override
////            public void onAnimationUpdate(ValueAnimator animation) {
////                imageView.setY((float) animation.getAnimatedValue());
////                imageView.requestLayout();
////            }
////        });
////        buttonAnimatorY2.setDuration(ANIMATION_DURATION_2);
////        buttonAnimatorY2.setRepeatCount(102400);
////        buttonAnimatorY2.setRepeatMode(ValueAnimator.REVERSE);
////        buttonAnimator2.play(buttonAnimatorY2).after(ballAnimator1);
////        buttonAnimator2.setStartDelay(exitDelay[position]);
////        buttonAnimator2.start();
//    }
//
//    /**
//     * 播放九球标题放大动画 - 位移放大
//     */
//    private static void playTitleAnimation(final ImageView title, int position, Activity activity) {
//
//        Tools.logByWh("playTitleAnimation position = " + position);
//        Tools.logByWh("playTitleAnimation startPositionX = " + startPositionX);
//        Tools.logByWh("playTitleAnimation titlePoints[position].x = " + titlePoints[position].x);
//        Tools.logByWh("playTitleAnimation startPositionY = " + startPositionY);
//        Tools.logByWh("playTitleAnimation titlePoints[position].y = " + titlePoints[position].y);
//
//        /**
//         * 更新alpha - 九球变大
//         */
//        final ValueAnimator alphaAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
//        alphaAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                title.setAlpha((float)alphaAnimator.getAnimatedValue());
//                title.requestLayout();
//            }
//        });
//        alphaAnimator.setDuration(ANIMATION_DURATION);
////        alphaAnimator.setDuration(0);
//
////        width = (int) activity.getResources().getDimension(R.dimen.button_width);
//
//        /**
//         * 动画，动画按钮的X和Y位置同时与尺寸
//         */
//        AnimatorSet buttonAnimator = new AnimatorSet(); // 动画集合 按钮动画 = new 动画集合();
//
//        /**
//         * 更新x - 九球x轴位置
//         */
//        ValueAnimator buttonAnimatorX = ValueAnimator.ofFloat(startPositionX,
//                titlePoints[position].x);
//        buttonAnimatorX.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                title.setX((float) animation.getAnimatedValue() - title.getLayoutParams().width / 2);
//                title.requestLayout();
//            }
//        });
////        buttonAnimatorX.setDuration(ANIMATION_DURATION);
//        buttonAnimatorX.setDuration(10);
//
//        /**
//         * 更新y - 九球y轴位置
//         */
//        ValueAnimator buttonAnimatorY = ValueAnimator.ofFloat(startPositionY,
//                titlePoints[position].y);
//        buttonAnimatorY.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                title.setY((float) animation.getAnimatedValue() - title.getLayoutParams().height / 2);
//                title.requestLayout();
//            }
//        });
////        buttonAnimatorY.setDuration(ANIMATION_DURATION);
//        buttonAnimatorY.setDuration(10);
//
//        /**
//         * 更新大小 -  九球变大
//         */
//        ValueAnimator buttonSizeAnimator = ValueAnimator.ofInt(1, width);
//        float moreSize = 1.0f;
//        if (position==0){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((175f/1080*moreSize)*DisplayWeight));
//        }else if (position==1){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((162f/1080*moreSize)*DisplayWeight));
//        }else if (position==2){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((243f/1080*moreSize)*DisplayWeight));
//        }else if (position==3){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((123f/1080*moreSize)*DisplayWeight));
//        }else if (position==4){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((162f/1080*moreSize)*DisplayWeight));
//        }else if (position==5){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((253f/1080*moreSize)*DisplayWeight));
//        }else if (position==6){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((162f/1080*moreSize)*DisplayWeight));
//        }else if (position==7){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((203f/1080*moreSize)*DisplayWeight));
//        }else if (position==8){
//            buttonSizeAnimator = ValueAnimator.ofInt(1, (int)((123f/1080*moreSize)*DisplayWeight));
//        }
//        buttonSizeAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
//            @Override
//            public void onAnimationUpdate(ValueAnimator animation) {
//                title.getLayoutParams().width = (int) animation.getAnimatedValue();
//                title.getLayoutParams().height = (int) animation.getAnimatedValue();
//                title.requestLayout();
//            }
//        });
////        buttonSizeAnimator.setDuration(ANIMATION_DURATION);
//        buttonSizeAnimator.setDuration(0);
//
//        /**
//         * 组合播放
//         */
//        buttonAnimator.play(buttonAnimatorX).with(buttonAnimatorY).with(buttonSizeAnimator).with(alphaAnimator);
////        buttonAnimator.play(buttonAnimatorX).with(buttonAnimatorY).with(buttonSizeAnimator).with(alphaAnimator).after(ballAnimator1);
////        buttonAnimator.setStartDelay(enterDelay[position]);
//        buttonAnimator.setStartDelay(0);
//        buttonAnimator.start();
//
////        /**
////         * 九球漂浮动画
////         */
////        AnimatorSet buttonAnimator2 = new AnimatorSet();
////        ValueAnimator buttonAnimatorY2;
////        if(position == 0){
////            buttonAnimatorY2 = ValueAnimator.ofFloat(titlePoints[position].y - 105,
////                    titlePoints[position].y - 105 - 10);
////        } else {
////            buttonAnimatorY2 = ValueAnimator.ofFloat(titlePoints[position].y - 79,
////                    titlePoints[position].y - 79 - 10);
////        }
////        Tools.logByWh("Animator - 九球漂浮动画 - position = " + position + " titlePoints[position].y = " + titlePoints[position].y);
////        buttonAnimatorY2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
////            @Override
////            public void onAnimationUpdate(ValueAnimator animation) {
////                title.setY((float) animation.getAnimatedValue());
////                title.requestLayout();
////            }
////        });
////        buttonAnimatorY2.setDuration(ANIMATION_DURATION_2);
////        buttonAnimatorY2.setRepeatCount(102400);
////        buttonAnimatorY2.setRepeatMode(ValueAnimator.REVERSE);
////        buttonAnimator2.play(buttonAnimatorY2).after(buttonAnimator);
////        buttonAnimator2.setStartDelay(exitDelay[position]);
////        buttonAnimator2.start();
//    }
//
//    /**
//     * 九球初始化
//     */
//    private static void initNineBall(Activity activity) {
//
//        points = new Point[BALL_NUM];
//        // 九球坐标
//        points[0] = new Point(ball_1_x,ball_1_y);
//        points[1] = new Point(ball_2_x,ball_2_y);
//        points[2] = new Point(ball_3_x,ball_3_y);
//        points[3] = new Point(ball_4_x,ball_4_y);
//        points[4] = new Point(ball_5_x,ball_5_y);
//        points[5] = new Point(ball_6_x,ball_6_y);
//        points[6] = new Point(ball_7_x,ball_7_y);
//        points[7] = new Point(ball_8_x,ball_8_y);
//        points[8] = new Point(ball_9_x,ball_9_y);
//
//        imageViews = new ImageView[points.length];
//
//        imageViews[0] = image_bg;
//        imageViews[1] = icon_2;
//        imageViews[2] = icon_3;
//        imageViews[3] = icon_4;
//        imageViews[4] = icon_5;
//        imageViews[5] = icon_6;
//        imageViews[6] = icon_7;
//        imageViews[7] = icon_8;
//        imageViews[8] = icon_9;
//
//        for (int i = 0; i < imageViews.length; i++) {
//            imageViews[i].setLayoutParams(new RelativeLayout.LayoutParams(1, 1));
//            imageViews[i].setX(0);
//            imageViews[i].setY(0);
//            imageViews[i].setTag(i);
////            imageViews[i].setOnClickListener(this);
//            imageViews[i].setVisibility(View.INVISIBLE);
//        }
//
//        imageViews[0].setImageResource(R.mipmap.bg1);
//        imageViews[1].setImageResource(R.mipmap.bg1);
//        imageViews[2].setImageResource(R.mipmap.bg1);
//        imageViews[3].setImageResource(R.mipmap.bg1);
//        imageViews[4].setImageResource(R.mipmap.bg1);
//        imageViews[5].setImageResource(R.mipmap.bg1);
//        imageViews[6].setImageResource(R.mipmap.bg1);
//        imageViews[7].setImageResource(R.mipmap.bg1);
//        imageViews[8].setImageResource(R.mipmap.bg1);
//    }
//
//    /**
//     * 九球标题初始化
//     */
//    private static void initNineTitle(Activity activity) {
//
//        titlePoints = new Point[BALL_NUM];
//        // 九球坐标
//        titlePoints[0] = new Point(title_1_x,title_1_y);
//        titlePoints[1] = new Point(title_2_x,title_2_y);
//        titlePoints[2] = new Point(title_3_x,title_3_y);
//        titlePoints[3] = new Point(title_4_x,title_4_y);
//        titlePoints[4] = new Point(title_5_x,title_5_y);
//        titlePoints[5] = new Point(title_6_x,title_6_y);
//        titlePoints[6] = new Point(title_7_x,title_7_y);
//        titlePoints[7] = new Point(title_8_x,title_8_y);
//        titlePoints[8] = new Point(title_9_x,title_9_y);
//
//        titles = new ImageView[titlePoints.length];
//
//        titles[0] = title_1;
//        titles[1] = title_2;
//        titles[2] = title_3;
//        titles[3] = title_4;
//        titles[4] = title_5;
//        titles[5] = title_6;
//        titles[6] = title_7;
//        titles[7] = title_8;
//        titles[8] = title_9;
//
//        for (int i = 0; i < titles.length; i++) {
//            titles[i].setLayoutParams(new RelativeLayout.LayoutParams(1, 1));
//            titles[i].setX(0);
//            titles[i].setY(0);
//            titles[i].setTag(i);
////            titles[i].setOnClickListener(this);
//            titles[i].setVisibility(View.INVISIBLE);
//        }
//
////        titles[0].setText("每日播报");
////        titles[1].setText("基因特征");
////        titles[2].setText("24H\n专属服务");
////        titles[3].setText("营养师");
////        titles[4].setText("精准用药");
////        titles[5].setText("健90\n严控条件");
////        titles[6].setText("我爱运动");
////        titles[7].setText("全息云档案");
////        titles[8].setText("中心点");
//
//        titles[0].setImageResource(R.mipmap.bg1);
//        titles[1].setImageResource(R.mipmap.bg1);
//        titles[2].setImageResource(R.mipmap.bg1);
//        titles[3].setImageResource(R.mipmap.bg1);
//        titles[4].setImageResource(R.mipmap.bg1);
//        titles[5].setImageResource(R.mipmap.bg1);
//        titles[6].setImageResource(R.mipmap.bg1);
//        titles[7].setImageResource(R.mipmap.bg1);
//        titles[8].setImageResource(R.mipmap.bg1);
//    }
//
//    /**
//     * 九球连线初始化
//     */
//    private static Point[] foldPoints;
//    private static int speed;
//    private static void initNineLine(Activity activity) {
//        foldPoints = new Point[7];
//        foldPoints[0] = new Point(ball_2_x,ball_2_y);
//        foldPoints[1] = new Point(ball_3_x,ball_3_y);
//        foldPoints[2] = new Point(ball_4_x,ball_4_y);
//        foldPoints[3] = new Point(ball_5_x,ball_5_y);
//        foldPoints[4] = new Point(ball_6_x,ball_6_y);
//        foldPoints[5] = new Point(ball_7_x,ball_7_y);
//        foldPoints[6] = new Point(ball_8_x,ball_8_y);
//        speed = 15;
//    }
//
//
//
//
//}
